package com.cy.jxc.controller;

import com.cy.jxc.entity.Goods;
import com.cy.jxc.service.GoodsService;
import com.cy.jxc.vo.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/goods/")
public class GoodsController {
    @Autowired
    GoodsService goodsService;
    @GetMapping("goods")
    public JsonResult doFindGoodsObject(){
        List<Goods> rows = goodsService.findAllGoods();
        return new JsonResult(rows);
    }
}
